#include<stdio.h>
int i=-1;
int list[1000];
/////////////////////////////////////
////MULTIPLE APPENDING IN A LIST/////
/////////////////////////////////////
void extend()
	{
	int num=0;
	char ch='y';
	while(ch=='y'||ch=='Y')
		{
		i++;
		printf("Enter the number");
		scanf(" %d",&num);
		list[i]=num;
		printf("Wanna Enter more(y/n)");
		scanf("%c",ch);
		}	
	}
void insertcumappend(int pos=i;)
	{
	int num=0;
	printf("Enter number to append");
	scanf(" %d",&num);
	/////////////////////////////
	////Appending in a List//////
	/////////////AND/////////////	
	////INSERTING IN A LIST//////
	/////////////////////////////
	for(j=i;j>pos;j--)
		{
		list[j+1]=list[j];
		}
	i++;
	list[pos]=num;
	}

void remove()
	{
	int num,flag=0;
	printf("Enter number to be removed");
	scanf(" %d",&num);
	for(j=0;j<=i;j++)
		{
		if(list[j]==num)
			{
			flag=1;
			while(j<i)
				list[j]=list[j+1];
			i--;
			break;
			}
		}
	if(flag==0);
		printf("ERROR: NUMBER NOT IN LIST!!!!!\n");
	}

void pop(int pos=i;)
	{
	if(i==-1)
	
	}

void index()
	{
	
	}

void sort()
	{
	
	}

void reverse()
	{
	
	}

void help()
	{
	
	}


void main()
	{
	int pos=0;
	int choice;
	printf("1)Append\n2)Extend\n3)Insert\n4)Remove\n5)Poplastelement\n6)Pop\n7)Index\n8)Count\n9)Sort\n10)Reverse\n11)Help\n12)Exit\nYour Choice ");
	scanf(" %d"choice);
	switch(choice)
		{
		case 1:
			{
			insertcumappend();
			break;
			}
		case 2:
			{
			extend();
			break;
			}
		case 3:
			{
			printf("Enter Position");
			scanf(" %d",&pos);
			insertcumappend(pos);
			break;
			}
		case 4:
			{
			remove();
			break;
			}
		case 5:
			{
			pop();
			break;
			}
		case 6:
			{
			printf("Enter Element to be poped out");
			scanf("Enter Element%d",&pos);
			pop(pos);
		case 7:
			{
			index();
			break;
			}
		case 8:
			{
			printf("Count is %d",i+1);
			break;
			}
		case 9:
			{
			sort();
			break;
			}
		case 10:
			{
			reverse();
			break;
			}
		case 11:
			{
			help();
			break;
			}
		default:
			{
			break;
			}
	}		
	
